package com.open.capacity.common.util;

public class RateUtil {
    /**
     * 将百分制转换为等级
     * @param rateType 评分类型
     * @param rate 传入后台的评分数据
     * @return
     */
    public static String rateConvert(String rateType,Object rate){
        if(rateType.equals("cent")){
            int point = Integer.parseInt((String) rate);
            if (point>=0 && point<60)
                return "E";
            if (point>=60 && point<70)
                return "D";
            if (point>=70 && point<80)
                return "C";
            if (point>=80 && point<90)
                return "B";
            if (point>=90 && point<=100)
                return "A";
        }
        return (String)rate;
    }
}
